package com.iplant.mes.service.po.sfc;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

/**
 * 工序上料记录
 *
 * @author YouWang·Peng
 * 2023-9-8 11:16:33
 */
@DBBasePO(TableName = "sfc_material_loading_record", Name = false, Active = false, Schemas = DBSchemas.MES,
        CheckName = {"Code", "TaskIPTID,MaterialID,BatchNumber"}, CodeAuto = true, CodePrefix = "SMLR-{yyMMdd}-",
        CodeNum = 4)
public class SFCMaterialLoadingRecord extends BasePO {

    /**
     * 自检单ID
     */
    @DBCondition
    @DBField
    public int TaskIPTID = 0;

    /**
     * 自检单编号
     */
    @DBCondition
    @DBJoin(name = "Code", tableName = "sfc_task_ipt", tableAsName = "sfc_task_ipt1", Schemas = DBSchemas.MES,
            MainTableField = "TaskIPTID")
    public String TaskIPTCode = "";

    /**
     * 工艺ID
     */
    @DBJoin(name = "RoutePartID", tableName = "sfc_task_ipt", tableAsName = "sfc_task_ipt1", Schemas = DBSchemas.MES,
            MainTableField = "TaskIPTID")
    public int RoutePartID = 0;
    /**
     * 工艺名称
     */
    @DBJoin(name = "Name", tableName = "fpc_routepart", tableAsName = "fpc_routepart1", Schemas = DBSchemas.PDM,
            ConditionalJoin = "fpc_routepart1.ID=sfc_task_ipt1.RoutePartID", JoinIndex = 2)
    public String RoutePartName = "";
    /**
     * 工艺工序ID
     */
    @DBJoin(name = "RoutePartPointID", tableName = "sfc_task_ipt", tableAsName = "sfc_task_ipt1", Schemas = DBSchemas.MES,
            MainTableField = "TaskIPTID")
    public int RoutePartPointID = 0;
    /**
     * 工艺工序名称
     */
    @DBJoin(name = "Name", tableName = "fpc_routepartpoint", tableAsName = "fpc_routepartpoint1", Schemas = DBSchemas.PDM,
            ConditionalJoin = "fpc_routepartpoint1.ID=sfc_task_ipt1.RoutePartPointID", JoinIndex = 2)
    public String RoutePartPointName = "";

    /**
     * 物料ID
     */
    @DBCondition
    @DBField
    public int MaterialID = 0;

    /**
     * 物料编码
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Code", tableName = "mss_material", tableAsName = "mss_material1", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialID")
    public String MaterialCode = "";

    /**
     * 物料名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "MaterialName", tableName = "mss_material", tableAsName = "mss_material1", Schemas = DBSchemas.Basic,
            MainTableField = "MaterialID")
    public String MaterialName = "";

    /**
     * 物料批次
     */
    @DBCondition
    @DBField
    public String BatchNumber = "";

    /**
     * 原料批次
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String RawMaterialLot = "";

    public SFCMaterialLoadingRecord() {
    }

    public SFCMaterialLoadingRecord(int taskIPTID, int materialID
            , String batchNumber) {
        TaskIPTID = taskIPTID;
        MaterialID = materialID;
        BatchNumber = batchNumber;
    }

    @JsonProperty("TaskIPTID")
    public int getTaskIPTID() {
        return TaskIPTID;
    }

    public void setTaskIPTID(int taskIPTID) {
        TaskIPTID = taskIPTID;
    }

    @JsonProperty("TaskIPTCode")
    public String getTaskIPTCode() {
        return TaskIPTCode;
    }

    public void setTaskIPTCode(String taskIPTCode) {
        TaskIPTCode = taskIPTCode;
    }

    @JsonProperty("MaterialID")
    public int getMaterialID() {
        return MaterialID;
    }

    public void setMaterialID(int materialID) {
        MaterialID = materialID;
    }

    @JsonProperty("MaterialCode")
    public String getMaterialCode() {
        return MaterialCode;
    }

    public void setMaterialCode(String materialCode) {
        MaterialCode = materialCode;
    }

    @JsonProperty("MaterialName")
    public String getMaterialName() {
        return MaterialName;
    }

    public void setMaterialName(String materialName) {
        MaterialName = materialName;
    }

    @JsonProperty("BatchNumber")
    public String getBatchNumber() {
        return BatchNumber;
    }

    public void setBatchNumber(String batchNumber) {
        BatchNumber = batchNumber;
    }

    @JsonProperty("RoutePartID")
    public int getRoutePartID() {
        return RoutePartID;
    }

    public void setRoutePartID(int routePartID) {
        RoutePartID = routePartID;
    }

    @JsonProperty("RoutePartName")
    public String getRoutePartName() {
        return RoutePartName;
    }

    public void setRoutePartName(String routePartName) {
        RoutePartName = routePartName;
    }

    @JsonProperty("RoutePartPointID")
    public int getRoutePartPointID() {
        return RoutePartPointID;
    }

    public void setRoutePartPointID(int routePartPointID) {
        RoutePartPointID = routePartPointID;
    }

    @JsonProperty("RoutePartPointName")
    public String getRoutePartPointName() {
        return RoutePartPointName;
    }

    public void setRoutePartPointName(String routePartPointName) {
        RoutePartPointName = routePartPointName;
    }

    @JsonProperty("RawMaterialLot")
    public String getRawMaterialLot() {
        return RawMaterialLot;
    }

    public void setRawMaterialLot(String rawMaterialLot) {
        RawMaterialLot = rawMaterialLot;
    }
}
